//
//  TabBarViewController.m
//  wifiStar
//
//  Created by HappyMilk 02 on 2017/7/11.
//  Copyright © 2017年 tomi. All rights reserved.
//

#import "TabBarViewController.h"
#import "HomeViewController.h"
#import "FindViewController.h"
#import "MoreViewController.h"
#import "DiscoveryViewController.h"
#import "WifiHeader.h"

@interface TabBarViewController ()

@end

@implementation TabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UIStoryboard *sb1 = [UIStoryboard storyboardWithName:@"more" bundle:nil];
    
    HomeViewController *vc = [sb instantiateViewControllerWithIdentifier:@"HomeViewController"];
    vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:K_NSLOCAL(@"Home") image:[UIImage imageNamed:@"tb_home_nol"] selectedImage:[UIImage imageNamed:@"tb_home_sel"]];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
    nav.navigationBar.hidden = YES;
    
    VC_INIT_NC_WITH_NIB_NAME_VC_NAME(DiscoveryViewController, discoveryViewController,navDiscoveryViewController);
    
    MoreViewController *vc2 = [sb1 instantiateViewControllerWithIdentifier:@"MoreViewController"];
    vc2.tabBarItem = [[UITabBarItem alloc] initWithTitle:K_NSLOCAL(@"More") image:[UIImage imageNamed:@"tb_more_nol"] selectedImage:[UIImage imageNamed:@"tb_more_sel"]];
    UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController:vc2];
    nav2.navigationBar.hidden = YES;
    
    self.viewControllers = @[nav,navDiscoveryViewController,nav2];
    
    
    ADD_OBSERVER(self, @selector(appinfoload), NOTIFICATION_APP_INFO_LOADED, nil);
    
    
}
- (void)appinfoload{
//    if (IS_PASS) {
//        CGPoint point = IS_IPAD?(CGPoint){0,__kheight-139}:(CGPoint){0,__kheight-99};
//        GADBannerView *bannerview = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait origin:point];
//        [self.view addSubview:bannerview];
//        bannerview.adUnitID = @"ca-app-pub-4634576436183649/2792130215";
//        bannerview.rootViewController = self;
//        [bannerview loadRequest:[GADRequest request]];
//    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
